package com.dxysun.mine.elasticjob;

import org.apache.shardingsphere.elasticjob.api.ShardingContext;
import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob;

public class MyJob implements SimpleJob
{

    @Override
    public void execute(ShardingContext context) {
        switch (context.getShardingItem()) {
            case 0:
                // do something by sharding item 0
                System.out.println("MyJob item 0");
                break;
            case 1:
                // do something by sharding item 1
                System.out.println("MyJob item 1");
                break;
            case 2:
                // do something by sharding item 2
                System.out.println("MyJob item 2");
                break;
            // case n: ...
        }
    }
}